<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
    CodeFile="Admin_SprintMaintenance.aspx.cs" Inherits="Admin_SprintMaintenance"
    Title="Tackle - Administer Sprint Maintenance" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentHolder" runat="Server">
    <strong>Administer Sprint Maintenance<br />
        <br />
    </strong><span style="font-size: 8pt">This page allows the deletion of sprints and tasks
        in sprints.
        <br />
        <br />
        <span style="color: red">This page can cause chaos to your project management and should
            be used with extreme caution!<br />
        </span>
        <br />
        <asp:UpdatePanel runat="server" ID="UPGridView" UpdateMode="Conditional">
            <ContentTemplate>
                <table style="width: 507px">
                    <tr>
                        <td>
                            <strong><span style="font-size: x-small">Sprint:</span></strong></td>
                        <td style="width: 233px">
                            <asp:DropDownList ID="ddSprintSelection" runat="server" AutoPostBack="True" DataSourceID="dsGetSprintNames"
                                DataTextField="SprintName" DataValueField="SprintID" Font-Size="X-Small" OnDataBound="ddSprintSelection_DataBound"
                                Width="229px">
                            </asp:DropDownList></td>
                        <td>
                            <asp:Button ID="btnDeleteSprint" runat="server" Font-Names="Verdana" Font-Size="X-Small"
                                OnClientClick="return confirm('This will delete all tracked time, tasks, features and retrospective notes associated with the sprint.\n\nWARNING: It is not possible to restore this data.\n\nAre you sure you want to delete this sprint?');"
                                Text="Delete Sprint" OnClick="btnDeleteSprint_Click" /></td>
                    </tr>
                    <tr>
                        <td>
                            <strong><span style="font-size: x-small">Feature:</span></strong></td>
                        <td style="width: 233px">
                            <asp:DropDownList ID="ddFilterProdFeature" runat="server" DataSourceID="dsFilterProdFeature"
                                DataTextField="ProdFeature" DataValueField="MasterBacklogID" Font-Names="Verdana"
                                Font-Size="X-Small" OnDataBound="ddFilterProdFeature_DataBound" Width="229px">
                            </asp:DropDownList></td>
                        <td>
                            <asp:Button ID="btnDeleteFeature" runat="server" Font-Names="Verdana" Font-Size="X-Small"
                                Text="Delete Feature" OnClick="btnDeleteFeature_Click" OnClientClick="return confirm('This will delete all tracked time and tasks associated with the feature.\n\nWARNING: It is not possible to restore this data.\n\nAre you sure you want to delete this feature?');" /></td>
                    </tr>
                </table>
            </ContentTemplate>
        </asp:UpdatePanel>
        <br />
    </span>
    <asp:SqlDataSource ID="dsGetSprintNames" runat="server" ConnectionString="<%$ ConnectionStrings:TackleConnectionStringMain %>"
        SelectCommand="SELECT tblSprint.SprintID, tblMasterBacklogSchedule.SprintName, tblMasterBacklogSchedule.MasterBacklogScheduleID FROM tblMasterBacklogSchedule INNER JOIN tblSprint ON tblMasterBacklogSchedule.MasterBacklogScheduleID = tblSprint.fMasterBacklogScheduleID WHERE (tblMasterBacklogSchedule.fScrumTeamID = @ScrumTeamID) ORDER BY tblMasterBacklogSchedule.EndDate DESC"
        ProviderName="<%$ ConnectionStrings:TackleConnectionStringMain.ProviderName %>">
        <SelectParameters>
            <asp:SessionParameter Name="ScrumTeamID" SessionField="ScrumTeamID" />
        </SelectParameters>
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="dsFilterProdFeature" runat="server" ConnectionString="<%$ ConnectionStrings:TackleConnectionStringMain %>"
        ProviderName="<%$ ConnectionStrings:TackleConnectionStringMain.ProviderName %>"
        SelectCommand="SELECT DISTINCT tblMasterBacklog.MasterBacklogID, tblProducts.ProductName + ' - ' + tblMasterBacklog.Feature AS ProdFeature, tblMasterBacklog.MasterRank AS MasterRank FROM tblMasterBacklog INNER JOIN tblSprintBacklog ON tblMasterBacklog.MasterBacklogID = tblSprintBacklog.fMasterBacklogID INNER JOIN tblProducts ON tblMasterBacklog.fProductID = tblProducts.ProductID WHERE (tblSprintBacklog.fSprintID = @SprintID)&#13;&#10;ORDER BY ProdFeature">
        <SelectParameters>
            <asp:ControlParameter ControlID="ddSprintSelection" Name="SprintID" PropertyName="SelectedValue" />
        </SelectParameters>
    </asp:SqlDataSource>
</asp:Content>
